<template>
  <div class="row">
    <Item v-for="item in info.dataList" :key="item.id" :item="item" />
    <h1 v-show="info.isWelcome">welcome!</h1>
    <h1 v-show="info.isLoading">加载中!</h1>
    <h1 v-show="info.errorMsg">{{ info.errorMsg }}</h1>
  </div>
</template>
<script>
import Item from "./ItemCon.vue";
export default {
  name: "List",
  data() {
    return {
      info: { dataList: [], isWelcome:true, isLoading: false, errorMsg: "" }
    };
  },
  mounted() {
    this.$bus.$on("getList", (data) => {
      this.info = {...this.info, ...data};
    });
  },
  components: {
    Item,
  },
};
</script>
<style scoped>
</style>